<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="js/react.development.js"></script>
    <script type="text/javascript" src="js/react-dom.development.js"></script>
    <script type="text/javascript" src="js/babel.min.js"></script>
</head>
<body>
    <div id="root">
    
    </div>
    <script type="text/babel">
        let arrList = ['北京','上海','广州','深圳'];

        // 遍历数组生成一系列相同的标签需要给一个唯一识别的key
        let oneJsx = (
            <ul>
                {arrList.map(item=><li key={item}>{item}</li>)}
            </ul>
        )

        // 通过函数和类返回一个jsx对象构成组件，否则直接赋值构成jsx对象不作为组件使用
        ReactDOM.render(oneJsx, document.getElementById('root'));
    </script>
</body>
</html>